package com.wcg.util;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidPooledConnection;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.wcg.javabean.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.sql.Connection;
import java.sql.SQLException;
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@RunWith(SpringRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class SpringTest {
    @Autowired
    DruidDataSource druid;
    @Autowired
    User u1;
    @Test
    public void u1() throws SQLException {
        System.out.println(u1);
    }
    @Test
    public void druid() throws SQLException {
        DruidPooledConnection connection = druid.getConnection();
        System.out.println(connection);
        connection.close();
    }

}